import $http from '@/http/config'
import Vue from 'vue'

const dictArr = {
	state: {
		dictArrs: {}
	},
	mutations:{
    SAVEDICTARRS:(state,objs)=>{
      for(let i in objs){
        Vue.set(state.dictArrs,i,objs[i])
      }
    }
	},
	actions: {
    //字典表 多个组合获取
    getDictlists({commit},params){
      $http.get('/cms/auth/dict/queryByTypes/'+params,{}).then(res=>{
        if(res && res.code == 0){
          var lists =res.data
          commit('SAVEDICTARRS',lists)
        }
      })
    }
  }
}

export default dictArr
